package com.insurance.modules.app.utils;

import com.insurance.modules.sys.entity.SysUserEntity;

public class LoginSysUserContext {
    //    private static final ThreadLocal<SysUserEntity> SYS_USER_THREAD_LOCAL = new ThreadLocal<>();
    private static final ThreadLocal<Long> USERID_THREAD_LOCAL = new ThreadLocal<>();

    /*public static SysUserEntity getLoginUser() {
        return SYS_USER_THREAD_LOCAL.get();
    }

    public static void setLoginUser(SysUserEntity sysUser) {
        SYS_USER_THREAD_LOCAL.set(sysUser);
    }

    public static void clearSysUser() {
        SYS_USER_THREAD_LOCAL.remove();
    }*/


    public static Long getLoginUserId() {
        return USERID_THREAD_LOCAL.get();
    }

    public static void setLoginUserId(Long userId) {
        USERID_THREAD_LOCAL.set(userId);
    }

    public static void clearSysUserId() {
        USERID_THREAD_LOCAL.remove();
    }
}
